package com.sbck.cs3;

import androidx.databinding.ObservableField;

import com.sbck.cs3.MyClass.DeviceLog;
import com.sbck.cs3.MyClass.HeartData;
import com.sbck.cs3.MyClass.MyAnnotation;
import com.sbck.cs3.MyClass.SocketUtil;
import com.sbck.cs3.MyClass.TChState;

import java.util.ArrayList;


public class MyGlobal {
    static  public Setting setting;

    static public int ServerPort = 9997;


    static public LoginUser loginUser;
    public static String convertSecondsToHMS(int seconds) {
        int hours = seconds / 3600;
        int minutes = (seconds % 3600) / 60;
        int remainingSeconds = seconds % 60;

        return hours + ": " + minutes + ": " + remainingSeconds ;
    }

    static public UNITINFO unitinfo;
    static public UNITSTATUS unitstatus;

    static public ArrayList<TChState> tChStateArrayList;

    static public boolean IsNetConnected=false;

    static public ArrayList<DeviceLog> deviceLogArrayList;
    static public ArrayList<HeartData> heartDataArrayList;
    static public ArrayList<UNITINFO> unitinfoArrayList;

    static public SocketUtil socketUtil;

    static public long HeartCount = 0;
    static public long ReceiveCount = 0;
    static public int TimeoutCount =0;

    static public boolean IsFirstRun = true;
    @MyAnnotation("弹出消息提示")
    static public ObservableField<Boolean> IsPopToast = new ObservableField<Boolean>();
    static public void AddLog(String msg, int color)
    {
        deviceLogArrayList.add(0,new DeviceLog(msg,color));
    }
}
